package com.rnkrsoft.suyan.config.internal.enums;

import com.rnkrsoft.interfaces.EnumIntegerCode;

/**
 * Created by woate on 2019/7/4.
 */
public enum  ResourceTypeEnum  implements EnumIntegerCode {
    PARAM(1, "参数"),
    FILE(2, "文件");
    int code;
    String desc;

    ResourceTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static ResourceTypeEnum valueOfCode(int code){
        for (ResourceTypeEnum value : values()){
            if (value.code == code){
                return value;
            }
        }
        throw new IllegalArgumentException("illegal code " + code);
    }
}
